package com.wesley.fritesfinder.model;

import java.io.Serializable;

public class FoodShop extends ActionPoint implements Comparable<FoodShop>, Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String name;
	private double rating;
	
	public FoodShop(double latitude, double longitude, String name,
			double rating) {
		super(latitude, longitude);
		this.name = name;
		this.rating = rating;
	}
	
	public FoodShop() {
		// TODO Auto-generated constructor stub
	}

	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public double getRating() {
		return rating;
	}
	
	public void setRating(double rating) {
		this.rating = rating;
	}	
	
	public int compareTo(FoodShop another) {
		return name.compareTo(another.name);
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof FoodShop) {
			FoodShop another = (FoodShop) obj;
			 return another.name.equals(this.name) && another.getLongitude() == 
				 this.getLongitude() && another.getLatitude()== this.getLatitude();
		} else {
			return false;
		}
	}
	
}
